package com.gc.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.gc.business.mapper.RegisterAgreementMapper;
import com.gc.business.domain.RegisterAgreement;
import com.gc.business.service.IRegisterAgreementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;

/**
 * 注册协议 服务层实现
 * 
 * @author liujinteng
 * @date 2020-12-29
 */
@Slf4j
@Service
public class RegisterAgreementServiceImpl extends ServiceImpl<RegisterAgreementMapper, RegisterAgreement> implements IRegisterAgreementService {

    @Override
    public List<RegisterAgreement> list(RegisterAgreement registerAgreement){
        LambdaQueryWrapper<RegisterAgreement> wrapper = new LambdaQueryWrapper<>();
        if(registerAgreement != null){
            if(StringUtils.isNotEmpty(registerAgreement.getRegisterId())){
                wrapper.eq(RegisterAgreement::getRegisterId, registerAgreement.getRegisterId());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getContent())){
                wrapper.eq(RegisterAgreement::getContent, registerAgreement.getContent());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getCreateBy())){
                wrapper.eq(RegisterAgreement::getCreateBy, registerAgreement.getCreateBy());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getCreateTime())){
                wrapper.eq(RegisterAgreement::getCreateTime, registerAgreement.getCreateTime());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getUpdateBy())){
                wrapper.eq(RegisterAgreement::getUpdateBy, registerAgreement.getUpdateBy());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getUpdateTime())){
                wrapper.eq(RegisterAgreement::getUpdateTime, registerAgreement.getUpdateTime());
            }
            if(StringUtils.isNotEmpty(registerAgreement.getRemark())){
                wrapper.eq(RegisterAgreement::getRemark, registerAgreement.getRemark());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
